package edu.zut.bailan.base.service;

import edu.zut.bailan.base.domain.BaseTreeEntity;

import java.io.Serializable;
import java.util.List;

public interface GenericTreeManager<T extends BaseTreeEntity<T, PK>, PK extends Serializable>
        extends GenericManager<T, PK>  {
    /**
     *
     * @param id id code for specified entity
     * @return ancestor list
     */
    public List<T> getAncestors(PK id);

    /**
     *
     * @param id id code for specified entity
     * @return children list
     */
    public List<T> getChildren(PK id);

    /**
     *
     * @param id id code for specified entity
     * @return all descentants list
     */
    public List<T> getDescendants(PK id);

    /**
     *
     * @return all roots list
     */
    public List<T> getRoot();
}
